package cn.rkylin.oms.warehouseDocking.adapter;

import org.apache.commons.lang.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.bson.util.StringRangeSet;

import cn.rkylin.apollo.common.util.BeanUtils;
import cn.rkylin.oms.common.base.AbstractAdapterFactory;
import cn.rkylin.oms.item.adapter.ItemAdapter;
import cn.rkylin.oms.item.adapter.ItemAdapterFactory;
import cn.rkylin.oms.item.adapter.TaoBaoItemVisitor;
import cn.rkylin.oms.system.shop.vo.ShopVO;

/**
 * 仓库适配器工厂
 * 
 * @author jipengcheng
 * @created 2017年10月16日
 */
public class WarehouseDockingFactory extends AbstractAdapterFactory {

    private static final Log logger = LogFactory.getLog(WarehouseDockingFactory.class);

    public WarehouseDockingFactory() {
        super();

    }

    /**
     * 判断shopType创建具体的adapter
     * 
     * @param shopId
     * @throws Exception
     */
    public static WarehouseDockingAdapter getWarehouseDockingAdapter(String shopId) throws Exception {

        // 注意: 目前只对接奇门, 以后可能会拓展此适配器
        WarehouseDockingAdapter warehouseDockingAdapter = null;
        if (StringUtils.isBlank(shopId)) {
            return warehouseDockingAdapter;
        }
        warehouseDockingAdapter = BeanUtils.getBean("qimenAdapter");
        WarehouseDockingVisitor warehouseDockingVisitor = BeanUtils.getBean("qimenVisitor");
        warehouseDockingAdapter.setWarehouseDockingVisitor(warehouseDockingVisitor);
        return warehouseDockingAdapter;
    }
}
